﻿using System;
using System.Collections.Generic;
using Microsoft.Practices.Composite.Regions;

namespace Infragistics.Composite.Wpf.UnitTesting
{
    public class MockRegionManager : IRegionManager
    {
        private readonly Dictionary<string, IRegion> _regions = new Dictionary<string, IRegion>();

        public IDictionary<string, IRegion> Regions
        {
            get { return _regions; }
        }

        #region Not implemented

        public void AttachNewRegion(object regionTarget, string regionName)
        {
            throw new NotImplementedException();
        }

        public IRegionManager CreateRegionManager()
        {
            throw new NotImplementedException();
        }

        #endregion
    }

    public class MockRegion : IRegion
    {
        public readonly List<object> ActivatedViews = new List<object>();
        public readonly List<object> AddedViews = new List<object>();
        public readonly List<object> RemovedViews = new List<object>();

        #region IRegion Members

        public IRegionManager Add(object view)
        {
            AddedViews.Add(view);
            return null;
        }

        public void Remove(object view)
        {
            RemovedViews.Add(view);
        }

        public IViewsCollection Views
        {
            get { throw new NotImplementedException(); }
        }

        public IViewsCollection ActiveViews
        {
            get { throw new NotImplementedException(); }
        }

        public void Activate(object view)
        {
            ActivatedViews.Add(view);
        }

        public void Deactivate(object view)
        {
            throw new NotImplementedException();
        }

        public IRegionManager Add(object view, string viewName)
        {
            throw new NotImplementedException();
        }

        public object GetView(string viewName)
        {
            throw new NotImplementedException();
        }

        public IRegionManager Add(object view, string viewName, bool createRegionManagerScope)
        {
            throw new NotImplementedException();
        }

        public IRegionManager RegionManager
        {
            get { throw new NotImplementedException(); }
            set { throw new NotImplementedException(); }
        }

        #endregion
    }
}